﻿using System;
using System.Collections.Generic;
using System.Text;
using DAL=IrisGenerator.Dal;
using System.Data;

namespace IrisGenerator.Common.DatabaseModel.DataAccess
{
    public class ConstraintType
    {
        private DAL.DataAccess _dataAccess;

        public ConstraintType()
        {
            this._dataAccess = new DAL.DataAccess();
        }

        public virtual System.Data.DataSet SelectFromName(string name)
        {
            this._dataAccess.CreateProcedureCommand("SelectConstraintTypeByName");
            this._dataAccess.AddParameter("name", name, ParameterDirection.Input);
            DataSet value = this._dataAccess.ExecuteDataSet();
            return value;
        }

        
        public virtual void Dispose()
        {
            if ((this._dataAccess != null))
            {
                this._dataAccess.Dispose();
            }
        }

        public DataSet SelectOne(Guid? Id)
        {
            this._dataAccess.CreateProcedureCommand("ConstraintTypeSelectOne");
            this._dataAccess.AddParameter("id", Id, ParameterDirection.Input);
            DataSet value = this._dataAccess.ExecuteDataSet();
            return value;
        }
    }
}
